package day03_template_method;

/**
 * @author Koizumi Sinya
 * @date 2018/11/07. 11:17
 * @edithor
 * @date
 */
public class StringDisplay extends AbstractDisplay {
    private String content;

    public StringDisplay(String content) {
        this.content = content;
    }

    @Override
    public void open() {
        printLine();
    }

    @Override
    public void close() {
        printLine();
    }

    @Override
    public void print() {
        System.out.println(content);
    }

    private void printLine() {
        System.out.print("+");
        for (int i = 0; i < content.length(); i++) {
            System.out.print("-");
        }
        System.out.println("+");
    }
}
